package com.treasure.web.mapstruct;

import com.treasure.infrastructure.model.po.ChatHistory;
import com.treasure.infrastructure.model.po.ChatHistoryDetail;
import com.treasure.web.command.response.chat.ChatHistoryDetailResponse;
import com.treasure.web.command.response.chat.ChatHistoryResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author sunhongmin
 * @date 2023/9/4 11:39
 * @description
 */
@Mapper
public interface ChatHistoryAssembler {

    ChatHistoryAssembler INSTANCE = Mappers.getMapper(ChatHistoryAssembler.class);

    ChatHistoryDetailResponse.HistoryResponse convertToChatHistoryDetail(ChatHistoryDetail chatHistoryDetail);

    List<ChatHistoryDetailResponse.HistoryResponse> convertToChatHistoryDetailList(List<ChatHistoryDetail> chatHistoryDetail);

    @Mapping(target = "interactionId",source = "id")
    @Mapping(target = "chatSummary",source = "summaryOfQuestion")
    ChatHistoryResponse convertToChatHistoryResponse(ChatHistory chatHistory);

    List<ChatHistoryResponse> convertToChatHistoryResponseList(List<ChatHistory> chatHistory);

}
